/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.staff;

import entities.StaffDetail;
import java.util.ArrayList;
import javax.swing.ComboBoxModel;
import javax.swing.event.ListDataListener;

/**
 *
 * @author VietLH
 */
public class StaffComboBoxModel implements ComboBoxModel{
    private ArrayList<StaffDetail> staffList;
    private StaffDetail selection;

    public StaffComboBoxModel(ArrayList<StaffDetail> staffList) {
        this.staffList=new ArrayList<StaffDetail>();
        this.selection=new StaffDetail();
        this.staffList = staffList;
    }
    

   @Override
    public void setSelectedItem(Object anItem) {
        selection= (StaffDetail)anItem;
//        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Object getSelectedItem() {
        return selection;
//        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public int getSize() {
        return staffList.size();
//        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Object getElementAt(int index) {
        return staffList.get(index);
//        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void addListDataListener(ListDataListener l) {
//        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void removeListDataListener(ListDataListener l) {
//        throw new UnsupportedOperationException("Not supported yet.");
    }
}
